<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>GAE Uploader</title>
    <style type="text/css">
<!--
img { border:none; }
#footer { margin-top: 1em; }
#filelist { margin: 1em 0.5em; }
#filelist th { background-color: #E5ECF9; }
#filelist th, #filelist td { padding: 2px; }
.even { background-color: #EEE; }
-->
    </style>
  </head>
  <body>
    <h1>GAE Uploader</h1>
    <p>Max filesize is approximate 1MB.<br />
Old file will be deleted automatically.(100files max)<br />
Don't upload file against the public order and standards of decency.<br />
    </p>
    {% if user %}
      <form id="upload_form" action="/upload" enctype="multipart/form-data" method="post">
        <div><label for="id_file">File:</label> <input type="file" name="file" id="id_file" /></div>
        <div><label for="id_comment">Comment:</label><input type="text" name="comment" id="id_comment" /></div>
        <div><input type="submit" value="Upload" /></div>
      </form>
      <div>{{ sign_link|fix_ampersands }}</div>
    {% else %}
      <p><b>Login required to upload.  {{ sign_link|fix_ampersands }}</b></p>
    {% endif %}
    {% if filelist %}
    <table id="filelist">
      <tr>
        <th>No.</th>
        <th>ID</th>
        <th>DL</th>
        <th>File</th>
        <th>Comment</th>
        <th>Size</th>
        <th>Date(UTC)</th>
        <th>Mime</th>
        <th>Delete</th>
      </tr>
      {% for file in filelist %}
        <tr class="{% cycle odd,even %}">
          <td>{{ forloop.counter }}</td>
          <td>{{ file.key.id }}</td>
          <td><a href="/file/{{ file.key }}?dl">[DL]</a></td>
          <td><a href="/file/{{ file.key }}">{{ file.name|escape }}</a></td>
          <td>{{ file.comment|escape }}</td>
          <td>{{ file.size|filesizeformat }}</td>
          <td>{{ file.created_at|date:"Y-m-d H:i:s" }}</td>
          <td>{{ file.mime|escape }}</td>
          <td>{% ifequal user file.author %}<a href="/delete/{{ file.key }}">Delete</a>{% endifequal %}</td>
        </tr>
      {% endfor %}
    </table>
    {% endif %}
    <div id="footer">
      <a href="http://code.google.com/appengine/">
        <img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" />
      </a>
    </div>
  </body>
</html>
